changed instance check to object