Fixed error on mac os x