handling empty cursor scenario
test refac