fixed error function call