added check for contact id