fixing service starting loop bug