added null check into domains