make js events clean up after themselves