fix error function call