updated to conditionaly set title