Fixing bug with loading files