fixed snippet code