modify upgrade_getsample