If you want help with code, you'll have to post an SSCCE demonstrating what you're actually doing. Otherwise we're just guessing.