Add handle for thrown exceptions