support InvalidCommand in function