support optional params to functions