Feature/fix upload race condition