fixed login functionality