Fixed Title update Function

fixed the title update function, tidied up a bit