Fix crash on launch in mac app