changed the error callback