fixed undefined function error