added logic to custom game mode