fixed a bug in inputhandler when deleting matched tokens