Added the ability to limit the length of added events