Attempt 2 to fix bug when creating new rules with UI.