listener in main thread