adds gameover function