Corrected defect in previous code