fixing bug with the popup