abort closes file when needed