fixed bugs in function body ast gen