fixing return on an http error