added callback function

added callback function when the loading is finished