change window and session handleing