try
    % write here the code written in the chapter
catch
    Screen('CloseAll')
    rethrow(lasterror)
end