Added flag to route errors to debug