changes to allow use with mod_wsgi