fixed slave so works for master failure and no failure