Fixed crash bug in applyOutputHandler()

Since the "next" parameter is missing in "applyOutputHandler",
an application crashes when "next" method is called in "staticMiddleware".

Please review my code and pull the changes.