Implemented addOrUpdateRecord