fixed login and added a reference to the context to each model object