add test and fix doc