I'm programmatically creating legend dijits. Map is loaded. Layer(s) loaded. The error occurs towards the end of _createLegend() method when it's try to set the _msg element innerHTML to NLS_noLegend string saying the _msg element is null. However, if I wrap in a 1 millisecond setTimeout it works fine. Why is this?