fix bug window() == None