little improvement in the function getTitles; little changes