fix package replacement magic