part 6 (fix undefined error)