add reg control code