Added query for fetching valid contacts using the isDeleted flag