after added preview code