added stuff to make this work with gunicorn