update code according to S4Vector package