fix bug in global.asax which was causing database errors