I'm really not sure what that code is supposed to do. You'll probably want to throw together an SSCCE that demonstrates what you're talking about.