implement insert, update methods