You need to post all of your code.

There is no way we can figure out what is wrong from this little snippet.

And use [ code ][ /code ] tags when posting source code.