correcting the title element to use the right variable