remove early return in function addNewRule