fix nested remoting function throwing error will crash app

Signed-off-by: Clark Wang <clark.wangs@gmail.com>