check if it's an array and add the values