Altered logic to remove warnings on MAC OS