state management bug fix and added ability to set no layer as the current layer.