Fixed a crash with uploading