better solution to the loading problem