fix "Program returns random data in a function"