Call only once in the middleware