fix some bug and the addrecord is done