add rule error checking