moved custom middleware to a different file