Debug it, modified some logic error