Enable to run the listener in a separate thread