add post validation and refactored into a partial