add chapter folder and fix bugs