working on leave game function