add many fix by old code