Problem calling a function from another function