fix repeated lookups