fix snippet code