Added null check based on crash reports