made cleanup events optional