add record fuction