fixed undefined function fatal error