starting to use select for the listener, remove threads