You're more likely to get help if you boil your problem down to an SSCCE that demonstrates exactly what you're talking about.