Fixed error handling with wrong username or password