modified to check for access to contact db