Changed the if conditional so that it was better for OS X.