fixed totalcost reset in a*