fix defragment bug