fixed handling of multiple files