fixed bug where login was throwing error when being called