Fix bug in upload callback