Changed type to instanceof