fixed problems in comparing lists