changed connect to take in buffers