fix the clearing of the popup