You could also move this call to just after the if download.get_status() in wait_state, then you only need to call it once.