Update history upload code