modified updateFreeList