write same code ,but only preview.