added funtionality: perform only if vm in right state!