Added better error callbacks