prevent crash when removing section in the middle