Problem caused by previous data flowing in

You change line 213 to read .....
Hang on, lost the mind link, you are just going to have to post your code sorry.