fix undefined err