added check for file size in bytes