fix resource loading issue