update loader function