adding bail_out and diagnostic methods