added pre and post rules
some changes