adding hideNav function to hide nav on click