Perhaps you should post all your code than we might see what's going wrong