fix undefined function error