add space in legend and fixed the layer order