correct the bug related to splineFun call