modify preview window update function