Fixed crash on re-render