[loader] Fix access to undefined loader instance