Fixed javascript error for nav