fix instance check