update test to cleanup listener. fixes for #945