Changed "savedDoc" to "oldDoc" in validation function.