fix plugin code. add check rules in test.