checking vm state before grep