improved login speed and added a test for bad authentication