Only write slaves if it is not empty.