fixed some minor loading code