added unit test for updating an existing string and fixed a bug