moved from is_a to instanceof in instance checking