fixed a small bug for Mac compilation