added validation for submission