passed lab 7 step 2 tests and fix several bugs of previous lab