Adding error callbacks