edit before_save to before_create in chap8