Fix bug with multiple records being added after the first addition