updated try except finally