rewrote the loading mechanism