Added is_array check