Fixed mac os crash