Error handling and file size unit added.