change if constraint for register cmd