fix small bug, still need further test for bg process