fixed error and supporting mac