titlebar updating code