added user model and login function