Added a dynamic title function