fix addrec when $id is given in JSON