fixed bug in load() function