adding in a bit of code so it runs on macs as well