resizing done and a workaround for weird Windows behavior