added insert and update methods