updated swapfile handling