Make sure to terminate the task when reaching the rate limit