added a few lines of code for celery support