handle spaces correctly in list