corrected a code segment