fixed popupAt to not instantly remove the popup when called from click event