Fixes bug that occurred upon uploading first file