prepare for moment function