Update tasks.py to accept the new values from detect()