fix the code to support mac