fixed title generation in some rare cases