Fixed coding error. Try-except-finally