fix command handled check bug