added debug check