added preview feature to the layout manager