changed how debug is checked