updated fault tolerance. has an error in swapToPrimaryServer