work-around for addOnTerminate