added functionalities for update insert