I think this may be related to this post
In that post I added a suggested solution with a link to a working example.