fix syntax error on function defined