Fix scrolling bug when closing popup