Fixed null pinter exception on startup on a mac