Modified for newer OS.