Invalid buffer for scratch window if window already exists