Popups - error checking on event listner