input: Write a function to identify and correct potential errors in the given Python function that attempts to modify a list while iterating over it. The corrected function should make a copy of the list before iterating to avoid unexpected behavior.
  
  def expand_list(list):
      list_copy = list[:]   # make a copy of the list
      for item in list_copy:
          list *= 2
  
  assert expand_list([1, 2, 3])==[1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]
  assert expand_list([])==[]
  assert expand_list([1])==[1, 1]
  assert expand_list([1, 1, 1])==[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  assert expand_list([1, 2])==[1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
output: def expand_list(list):
      list_copy = list[:]
      for item in list_copy:
          list *= 2
      return list