edited localization code