added snippet preview
Fixed bug with snippet preview