fixed bug in loading files