Modify how to test is user is logged and redirect