connect for write