Fixed the cost bug when server failed