fixed undefined func