Fixed error handling (finally)