improving paths determination during file loader, less likely to pass undefined and break node