fix segfault after game