fix rule bugs
integrationtest passed
fix missing rule dependency and buggy variable name