copied over slave setup