fixed a bug in recognition