Adding timeout to listen_sync.