ticket:3 add test & some corrections