fix undefined ref error