correct two bugs and pass the test