Get UserBasedExceptionMiddleware working