fixing click events for pop-ups