fixing os error condtion