redirect to the proper page when logging in