Added the cleanup event

I've added the cleanup event with the corresponding qunit test