Fix calling function as celery task