Finally we have a correct version, it works properly in each case