stage 2 added wait loop and notify service