Update tasks.py

a small bug fix.