added checkwinsize opt