added completed poll method in pure SQL