added debug to check exit failures