layer names can sometimes have spaces in them which causes problems when setting it as an element's id - replacing with an underscore should fix the problem