fixed login functions and login page