Update middleware to not require debug flag