fixed bug that would throw exception during login