add error checking when no results are returned