updated rules.js