routine for corrections