fixed bug in bgservice