Fix crash when a command is executed that affects check services

fixes #5297