fixed a bug on the matcher unregister function