fixed garbage collection to be before update gathering