implemented game state detection and messaging