added method to get current machine state