add prepareCall fuction