Added fix for error handling middleware

* Fixed parameters for catch all error middleware