Update loading code