Fix for preview crash