What is the line number of your error. Going thru the whole code without knowing the line of error is difficult to find out the issue.