Check actual task for value of 'complete', not @task variable