changed check for lists