use instance_of? instead of is_a?