fix lesson 8 bugs