update sc code logic