preventDeafault when closing popup on the dashboard