Fixed crash in preview