Changing layouts will restart the layout.
You can avoid this by saving the progress made in the layout.
You could use global variables for this or webstorage and on layout start check if the variables are changed and set the game accordingly.
Another option would be to have the pausescreen on the layout itself and therefor not having to change and restart layouts.