fixed undefined function