Fix a bug in record manager