fixing issue when no results are returned