Fixed bug where canceling an upload crashed the plugin