fixes bug that was causing listener leak