make Connection buffered and thread safe