Added temp work around for addOnTerminate.