updated dynamic title function