changed the way of patching