fix broken debug flag check