updated listen so if listen is called with a preregistered listener object pair the old listener is overwritten