fixed minor bug in comparing two lists