implementing add and delete record functions