now properly changes title and the text in the window