fixed error with not defined function