Post your complete code; it's impossible to find bugs in code we can't see.