fixed bug and updated doc