Fix createRoot function