adding polling to check for  maint mode exit