added error check for OS type