a couple of changes to allow this to run in IIS