fixed a case where an error would occur when nothing was returned.