fixed bug with swap file generation