fix to work with wsgi