Very cool idea, the only problem is the game-freezing bug that you've already described.
Yeah I wish I could fix it, idk why it happens though :(