Fix initialisation of err variable after uploading data