changed the way to check for instance id