added switch for background and maxEvents