check if data is array before save