added validation for interval