call p2n_invoke on main thread