connect before write/read