final version,everything  should working