Fixes a bug in login