moving localization before dom insertion - per Mike's review