how to query contact