isinstance() error fixed