Fixed a bug when closing the nav menu