Fixed if statement to so ArcGISDynamicMapServiceLayers work.