store rule in db