Added error hook.