Fixed the bug with switching between processes.