fixing the list function