fix small bug
 add unittest
 .