apply patches