resolve ctx args in function calls