fix bug in parser with nested function calls
add support for nested function calls