fixes situation where $list is an array of empty strings