Fixed the order of upload vs s3