release locks when exceptions hit