You're right ltrim seem to be perfect I just don't remember why I replaced it by lpop...

I will make an other try