fix crash during upload