MacOS compatibility fix