fixed break loop issue