fix bug with preview and update some display logic