fixed a bug in the previewer