Fixed an error in the loading function.