add tests for updating and fix deleting