Added some try catch so the flask app can work without celery