added check to prevent stop command from throwing