figure out instance automatically