check for window first