issue #15 + avoid risk looping forver + work on performance