better handling of multiple patches