flush output buffer on crash