fix some of the missing logic for localization