Added file size checking