fixed bugs for improvement of preview.