fix chapter handling