changed js counter so it stops counting down when game ends