added validation for times