Adds handling of invalid popups