Fixed unclosing process after exeption occured