work on rule handling