modify window handling