fixed registration/login/redirect bug