fixed and added more tests for user model