fixed the problems with multiple files