fix error message: warning: wrong element type nil at 0 (expected array)