Implement the stopping of the listener.