added rudimentary error handling for login action