If you want help with code, you'll have to provide an SSCCE that demonstrates the problem.