fix a lot bugs because of unthinkable faults