added error handler for duplicate logins