Fix infinite loop

hope fixed #8