fixed error reporting in case of undefined function