Added isInstance function