Ask if defined? against the instance. And don't open it if doing nothing