change from middleware to server.