add setRule method