Fix error when logging in by username