Fix javascript bug causing mobile nav not to work