Fixes bug regarding end game