correcting the code