Modified login method to returh login errors