modify check rule and fix some bugs