Merge "Fix the get loop state logic"