Fixes bug with loging in