improve initial positioning of window