update to handle empty arrays posted by rails forms