Fix isinstance issue