fix query to consider the right machine