Improved the cancelling of the screen capturing process.