Updated maintenance mode checking