a bit fix and code refining and test