support run inside a WSGI server