add missing prepare method to 2nd function