fixed stack smashing on large windows