Fixed bug of upload constructor