moved tcp server into a gen_server