add custom middleware