I see! When a checkpoint system is not planned, trying to fit it to an existing code is quite hard.
Even with your solution, the restart is smooth and the player will not notice.
Congrats again for the game! Keep it up.