restructure the project and fix many bugs,not need to use setTimeout