fixed instance check bug