Fix undefined function issue