patch with complile function