Fix bug with mac os x