Hey guys I really like your app that's some extremely well written code! 😁 I think I can see the problem, When the program gets the 204 status code, it begins calling the call_refresh function which in turn calls the get_now_playing_track() function again There is a call stack of currently running functions, every time a function is called it gets added to the top of the call stack. The problem is that the functions here don't get removed because they never get the chance to finish as there are constantly more and more functions called which get added to the top of the call stack Eventually, we hit the maximum recursion depth (stack overflow error), which is 1000 by default in Python I think The main fix is that we remove the call to get_now_playing_track() from within the call_refresh() function. This way, we prevent the stack overflow I also recommend changing your if response.status_code == 204 statement to something like the snippet below. We simply return to kill the function, the get_now_playing track function will be called again from the While loop in a few seconds so there is no need to repeat the API call I recommend that when you make your instance of the RunBotify() class, you simply call played_track_manager() on its own (after refreshing token) which will fire up the while loop Note: I also added a check for 429 status code just in case there is the unlikely event that you hit the API rate limit, but that is almost certainly not going to happen Here are my suggested modifications for the if statements in the get_now_playing_track() function if response.status_code == 204: print("NOTHING PLAYING") time.sleep(30) self.call_refresh() return if response.status_code == 429: print("[!] API rate limit exceeded") return Here are my suggested modifications to the call_refresh() function, also the final line calls the played_track_manager() function to begin checking the songs def call_refresh(self): self.spotify_token = refresh() a = RunBotify() a.call_refresh() a.played_track_manager() I hope that makes sense :) So to summarise the issue was when no song is playing, the get_currently_playing function never actually finishes running because it just calls another one of its self The reason why this doesn't happen when songs are playing, is because they only spawn another version of themselves if temp != self.nowtrack, otherwise the function terminates thus the call stack doesn't get overwhelmed I hope that helps, all the best Euan