cleaning main and login error

login error handling