fix: temp file is automatically deleted when handle is closed
fix: correct boolean check