added check for files