correction logic