fixed login and redirect mechanisms