fixed a bug on login caused by previous refactoring of models