working add_code from popup