fix #39, do select in thread to avoid blocking main thread