Correct crash on mac