Fixed an error in the before_validation

before_validate should be before_validation