Fix loading state problem