update code for contact sample