added confirm_code method