diff --git a/main.py b/main.py
index 8135697cb44fed90aa635cd64a462aa79139b3a4..ffae918abedb5bb76e8627986de6b9080d5fc3af 100644
--- a/main.py
+++ b/main.py
@@ -66,7 +66,7 @@ PAUSE_TIME = 0.75  # seconds
 
 class QuizzerApp(App):
     DEFAULT_QUESTION = ('What is your favorite color?', ('Blue', 'Blue', 'Blue', 'Blue'), 'Blue')
-
+    QUIZ_LENGTH=5
     include_gui_topic = BooleanProperty(True)
     include_color_topic = BooleanProperty(False)
     include_tree_topic = BooleanProperty(False)
@@ -121,6 +121,10 @@ class QuizzerApp(App):
             self.questions.pop()
         if len(self.questions) == 0:
             self.reshuffle()
+        if self.attempts >= QuizzerApp.QUIZ_LENGTH:
+            self.attempts = 0
+            self.score = 0
+
 
 
 if __name__ == '__main__':
diff --git a/quizzer.kv b/quizzer.kv
index e7f913f21de63b4c41364008eca987a1cbf75519..a88b78f139ed0a325fac7885ba1c687c4711af76 100644
--- a/quizzer.kv
+++ b/quizzer.kv
@@ -85,7 +85,7 @@ ScreenManager:
                 size_hint: (1, None)
                 size: (self.texture_size[0] + 64, self.texture_size[1] + 64)
             ProgressBar:
-                max: 5
+                max: app.QUIZ_LENGTH
                 value: app.attempts
                 size_hint: (1, None)
                 height: sp(8)