Error during PIE initiation and after play once

As GameMode inherits from Actor, you could override EndPlay which should be called once PIE ends.