passing function in function custom logic delegate