added check for file size