fix exception
fix apple compilation