working on thread to handle client connection