Call function and replace arguments correctly