added error message
fixed the error message location and also moved the call to save_to_external after saving revision