finally working
works, but stackoverflow when saving project after pausing it