fix upload bugs