added preview handler