Perhaps if we see all of your code we could help better.