fix indent bug and some other bugs