fix ensure error callback