fix id pattern and id updating when delete, fixes #225