Fix logic to fix for Bug: 12347