clear code and add register target