added body close for failure path