fix issue with \thechapter not being defined