changed uniq! to uniq to fix NilClass issue