fix issue: not cleanup flash after timeout