Finally solved the upload bug