handle no results, and handle stack overflow