OS logic improved