serialize the array before adding it to the db