Fix attack code