check defined before testing order