Use instanceof to test object type instead testing random properties