copied window killer from @skwp