added more functionality to preview page