Handling rules.length is undefined error

added try/catch to ignore error when rules.length is undefined, so
script can continue to execute as page resizes.
Merge pull request #83 from micahjm/master

Handling rules.length is undefined error