Add a callback on crash