fix upload code