Fix loading dialog crash