This is a quick patch.. probably needs more thought but we've used it in our project

This would probably be better as an option, but there you are.