added validation for type on post