added check for file