add record logic
add record logic