chapter 6 user model with validation