Fixe eternal loop issue