changing parameter logic for the addrecord function