change generate to show preview right away