add a function for processing contact