Why is my recursive function not using an updated state value

visit shbcf.ru