change debug to exception