fixed log in and added tests for new user story