change maxEvents to VarParsing