add function guards sample