Resolve the problem that the app hangs up when close it.