add patch code