building function GetCriteria()