added validation for post and registration