Added an else branch in the code for Macs.