fix endless loop issue (0.2.2)