fix    bug and delete some code