fixed bugs, merged parameter and local stacks