handle connections a bit better