Fix bug of array_extend functionalty