still not perfect but better

https://github.com/joomla/joomla-platform/issues/673#issuecomment-28113566