added flag to check if a celery task is running