add snippet condition in projection function