refactor js, enable previous nav on first move