Updated mac check to be more robust