Updated logic in tasks.py to insure services are deactivated