Rather than forcing us to guess what is wrong with the code, how about showing it, that might be a good start...