make sure that patches are applied only once