Added TableHasRows condition