IDEX-1708: fix deleting temp files