fix bug in Flask output when DEBUG=False