restored all logic with test listeners