added termination-sensitive monitor (not tested)