fix some bugs about processes and device, but there are lots of bugs there.