Fix write method

Fix write method. and the updateEntry does not work for msgid in array, so I added a setEntries method.