Added deferred logic to upload