Looks like root here refers to window, so we should probably just remove this if statement.