correcting function