update conditional to check for window