Fix to work with wsgi