fixed errors and add test code