added ksRegisterFunction