added error output features in upload_patients