Add more debug to find infinite loop problems