corrected code