Fix upload crash