Added error handling for private key on login