fixed an error caused by increasing window number by 1