fixed bug for preview