debug mode gives the rigth answer, but not in release mode
cant find why we get the wrong answere in release mode