added some stuff to do with client connection