Mac crash fix