added check for multiple files