Fix undefined function error