committing the pcal code before switching layer and view