fix undefined function