updated add to list method to prevent empty strings