support function ptr as parameter