add prepare method