fix bug for nested data