corrected bug from the yoho code