added mode change support for layer removal/adding