Added insert, update functions