improve command check

Define whether current command is connected with the right figure