patch code attribute