Adding an error callback.