fixed preview mode bug