add validation on user model
clean up flash message handle and add flash_class helper method