Added custom middleware