Fixed error with add-to-list inside the condition