update loading function