improved multifile handling