finally fixed the popout bug