Changed id generation for rules