Added more logic to the userModel