Control logic enhencement.

Signed-off-by: vjt7312 <vjt7312@gmail.com>