Adopted to MacOS