insufficient check on array in line 87 and 106, add is_array to check it