fixed a bug on hw 8