Check in identical function if object is a list