fix some bug at dormitory

1. typo in Rule function
2. add rule as an member of a condition
3. refine the judge flow