add duplicate record check
add update record logic