how to apply patches