Reverted to 9bb7e9267be5915ba6aeba52b9f13785abbdaba2
fixed rule gen bug