Callback was not dealing with errors correctly