Add check for debug mode