added error handling to the yam.login feature