fix undefined array