handle no results and errors