Changed the logic which finds the machine name