handles login errors