Adding is_array check to avoid notice