fixed issues for preview mode