fixing the contains method for list