added recognition logic