Properly checking if debug mode is active