corrected undefined errors