fix bug in function calls; add default param to class