add end-game functions to UI buttons