correcting the code in order to compile