add method to add rule