Closes popup if displayed