return 0 on crash