bug fixes around adding new records