fix sample bugs