bug fix for preview