fix snippet bugs