Improved hideModal support